package jdbc;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

public class JdbcTest {
	public static void JdbcTest(){
		try {
			Class.forName("com.mysql.jdbc.Driver");
			Connection conn = DriverManager.getConnection("jdbc:mysql://192.168.1.200:3306/test", "root", "root");
			Statement st = conn.createStatement();
			ResultSet rs = st.executeQuery("select * from user");
			while(rs.next()){
				String name = rs.getString("name");
				System.out.println(name);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	public static void main(String[] args) {
		JdbcTest.JdbcTest();
	}
}
